<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Document</title>
	</head>
	<body>
		<script type="text/javascript">
			//跨模块常量
			//contants.js文件
			export const A=1;
			export const B=3;
			export const C=4;
			......A
			//test.html文件
			import * as constants from './constants.js';
			console.log(constants.A);//1
			console.log(constants.B);//3
			......
			//test2.html文件
			import {A,B} from './constants.js';
			console.log(A);//1
			console.log(B);//3
		</script>
	</body>
</html>